<?php
if($_SESSION["name"]){
    echo "获取session中的用户名为：" . $_SESSION["name"];
    echo '<br>';
    echo "<a href=\"logout.php\">退出系统</a>";
}else{
    echo "无用户名<br>";
    echo "<a href=\"login.php\">去登录</a>";
}

?>